#!/usr/bin/env python
# coding=utf-8

from grpc.beta import implementations

import hello_pb2

_TIMEOUT_SECONDS = 10

def run():
    channel = implementations.insecure_channel('localhost', 50051)
    stub = hello_pb2.beta_create_Greeter_stub(channel)
    rsp = stub.sayHello(hello_pb2.HelloReq(name='jsongo'), _TIMEOUT_SECONDS)
    print "Greeter client received: %s" % rsp.msg


if __name__ == '__main__':
    run()
